package org.nidy.programexercise.Stream;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class MiddleStream {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        Collections.addAll(list,"张山丰","张翠山","赵敏","张无忌","韦一笑","韦小宝");
        Stream<String> z = list.stream().filter(s -> s.startsWith("张")).limit(3).skip(1);
        System.out.println(z);
        List<String> collect = list.stream().collect(Collectors.toList());
        System.out.println(collect);
        List<String> list1=new ArrayList<>();
        Collections.addAll(list1,"1","5","9","2","6");
        Stream<String> concat = Stream.concat(list.stream(), list1.stream());
        concat.forEach(System.out::println);
    }
}
